package com.example.logic.chapter4.demo5;

/**
 * @Date 2023-05-02
 * @Author Jonathan
 */
public class Child /*extends Base*/ {
    private long sum;

    private Base base;

    public Child() {
        this.base = new Base();
    }

    public void add(int number) {
//        super.add(number);
        base.add(number);
        sum += number;
    }

    public void addAll(int[] numbers) {
        base.addAll(numbers);
        for (int number : numbers) {
            sum += number;
        }

    }

    public long getSum() {
        return sum;
    }
}
